#!/usr/bin/perl

use strict;

my $ADDR_NATV = "2620:3b:0:1065::c9";
my $ADDR_6TO4 = "2002:c001:65c9:1::1";
my $TARGET_FILE = "targets.txt";
my $SLEEP_TIME = 120;

my @targets = `cat $TARGET_FILE`;
chomp @targets;
foreach my $target (@targets) {
    if ($target =~ /\./) {
        system("ping -c 1 $target 2>&1 >/dev/null &");
    } elsif ($target =~ /:/) {
        system("ping6 -c 1 -S $ADDR_NATV $target 2>&1 >/dev/null &");
        system("ping6 -c 1 -S $ADDR_6TO4 $target 2>&1 >/dev/null &");
    }
}
